import myaxios from "../MyAxios"
import BASEURL from '../BaseUrl' 
const JKTURL = BASEURL.JKTURL

const doneApi = {

  /**
   * 新增已激活题目
   * @param {Object} params  { done_options:xx, done_state:xx, done_collect:xx, exerId:xx, userId:xx}
   */
  add(params){
    let url = JKTURL + "/exer-done/add"
    return myaxios.post(url, params)
  },

  // 更新已激活题目
  update(params){
    let url = JKTURL + "/exer-done/update"
    return myaxios.post(url, params)
  },

  queryByUser(params){
    let url = JKTURL + "/exer-done/0"
    return myaxios.get(url, params)
  },

  queryByUserC(params){
    let url = JKTURL + "/exer-done/3"
    return myaxios.get(url, params)
  },

  // 查询用户已激活题目 (按激活时间排序)
  queryByUserA(params){
    let url = JKTURL + "/exer-done/1"
    return myaxios.get(url, params)
  },

  // 查询用户已激活题目 (按题库序号排序)
  queryByUserB(params){
    let url = JKTURL + "/exer-done/2"
    return myaxios.get(url, params)
  },

  /**
   * 查询用户做错的题目 (科目)
   * @param {Object} params  { userId:xx, done_state:xx, done_subj:xx }
   */
  queryByWrong(params){
    let url = JKTURL + "/exer-done/wrong"
    return myaxios.get(url, params)
  },

  // 查询用户收藏的题目
  queryByCollect(params){
    let url = JKTURL + "/exer-done/collect"
    return myaxios.get(url, params)
  },


}

export default doneApi